package com.wind.common.config;

import com.wind.common.interceptor.CustomHandlerInterceptor;
import jakarta.annotation.Resource;
import lombok.AllArgsConstructor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * web配置
 *
 * @author FengYin
 * @since 2024/8/30 09:11
 */
@Configuration
@AllArgsConstructor
public class WebMvcConfiguration implements WebMvcConfigurer {

    @Resource
    private final CustomHandlerInterceptor customHandlerInterceptor;


    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        // 拦截器
        registry.addInterceptor(customHandlerInterceptor)
                .addPathPatterns("/**").order(1);
    }


}
